<template>
  <view>
    <button type="default"
            style="width: 80%; background-color: #007aff; color: #fff; margin-top: 60rpx"
            @click="
              () => {
                show = true;
              }
            "
    >
      选择文件
    </button>
    <view v-for="(item, index) in pathArr" :key="index" class="textStyle">
      <view> 文件名：{{ item.name }} </view>
      <view> 文件地址：{{ item.url }} </view>
      <view> 文件大小：{{ item.sizeMB }} </view>
    </view>
    <nk-select-file v-model="show" @confirm="getPath" />
  </view>
</template>

<script>
export default {
  data() {
    return {
      show: false,
      pathArr: [],
    }
  },
  methods: {
    getPath(event) {
      console.log(event)
      this.pathArr = event
    },
  },
}
</script>

<style>
.textStyle {
  width: 100%;
  text-align: center;
  margin-top: 40rpx;
}
</style>
